<include file="Public:head" title="{$ctitle}"/>

<script type="text/javascript" src="__PUBLIC__/js/Jquery/highcharts.js"></script>
<script type="text/javascript" >
    $(function() {
        var order_data = '{$order_data}';
       console.log(order_data);
        order_data = eval("(" + order_data + ")");//
        var months = '{$statics_cat}';
        months = eval("(" + months + ")");//
        var type = '{$type}';
        if (type == 2) {
            getPieHighcharts("#highchart_area", order_data);
        } else {
            getColumnHighcharts("#highchart_area", months, order_data, type);
        }
    })
</script>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <include file="Public:left" />
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="__APP__/{$Think.MODULE_NAME}">首页</a></li>
                    <li><a href="{:U('Statics/turnover')}">统计报表</a></li>
                    <li class="active">用户量</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="header smaller lighter blue">
                                    <button class="btn btn-success" onclick="$('#modal_set').modal('toggle')">报表设置</button>
                                    <div class="nav-search col-xs-10" id="nav-search">
                                        <form class="form-search" method="get">
                                            <div class="search_area">
                                                <select  onchange="goOrderUrl('{$mtype}')" id="type" class="select_cat" autocomplete="off">
                                                    <option value="0" <if condition="$type eq 0">selected</if>>柱状图</option>
                                                    <option value="1" <if condition="$type eq 1">selected</if>>折线图</option>
                                                    <option value="2" <if condition="$type eq 2">selected</if>>饼状图</option>

                                                </select>
                                                <select  onchange="goOrderUrl('{$mtype}')" id="year" class="select_cat" autocomplete="off">
                                                    <option value="0" <if condition="$year eq 0">selected</if>>请选择年份</option>
                                                    <foreach name="years" item="row">
                                                        <option value="{$row}" <if condition="$year eq $row">selected</if>>{$row}</option>
                                                    </foreach>
                                                </select>
                                                <select onchange="goOrderUrl('{$mtype}')" id="month" class="select_cat" autocomplete="off">
                                                    <option value="0">请选择月份</option>
                                                    <foreach name="months" item="row">
                                                        <option value="{$row}" <if condition="$month eq $row">selected</if>>{$row}月</option>
                                                    </foreach>
                                                </select>
                                                <select onchange="goOrderUrl('{$mtype}')" id="day" class="select_cat" autocomplete="off">
                                                    <option value="0">请选择日</option>
                                                    <foreach name="days" item="row">
                                                        <option value="{$row}" <if condition="$day eq $row">selected</if>>{$row}</option>
                                                    </foreach>
                                                </select>
                                            </div>
                                        </form>
                                    </div>
                                    <div class='cl'></div>
                                </div>
                                <div id="highchart_area"style="height:440px;padding:20px">
                                </div>
                                <notempty name='lists'>
                                    <div class="table-responsive">
                                        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                            <thead>
                                                <tr>
                                                    <th width='120px'>时间</th>
                                                    <th>新增用户量</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <foreach name="lists" item="row">
                                                <tr>
                                                    <td>{$row.t}</td>
                                                    <td>{$row.num}</td>
                                                </tr>
                                            </foreach>
                                            </tbody>
                                        </table>
                                    </div>
                                    <else/>
                                    <p class='noempty'>没有符合条件的记录！</p>
                                </notempty>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file="Public:setting" />
    </div>
</div>
<include file="Public:del" />
<include file="Public:foot" />
<div class="modal fade" id="modal_set" data-id="0" tabindex="-1" role="dialog" aria-labelledby="modal_delLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">默认设置</h4>
            </div>
            <div class="modal-body">
                <select   data-name="type" class="select_cat" autocomplete="off">
                    <option value="0" <if condition="$type eq 0">selected</if>>柱状图</option>
                    <option value="1" <if condition="$type eq 1">selected</if>>折线图</option>
                    <option value="2" <if condition="$type eq 2">selected</if>>饼状图</option>

                </select>
                <select   data-name="year" class="select_cat" autocomplete="off"  onchange="yearChange($(this))" id="set_year">
                    <option value="0" <if condition="$year eq 0">selected</if>>请选择年份</option>
                    <foreach name="years" item="row">
                        <option value="{$row}" <if condition="$year eq $row">selected</if>>{$row}</option>
                    </foreach>
                </select>
                <select  data-name="month" class="select_cat" autocomplete="off" onchange="monthChange($(this))" id="set_month">
                    <option value="0">请选择月份</option>
                    <foreach name="months" item="row">
                        <option value="{$row}" <if condition="$month eq $row">selected</if>>{$row}月</option>
                    </foreach>
                </select>
                <select  data-name="day" class="select_cat" autocomplete="off" id="set_day">
                    <option value="0">请选择日</option>
                    <foreach name="days" item="row">
                        <option value="{$row}" <if condition="$day eq $row">selected</if>>{$row}</option>
                    </foreach>
                </select>      
            </div>
            <div class="modal-footer">
                <button class="btn btn-danger btn-xs ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false" onclick="statics_set('Statics', 'users')">
                    <span class="ui-button-text">
                        <i class="icon-trash bigger-110"></i>
                        确 定
                    </span>
                </button>
                <button class="btn btn-xs ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false" data-dismiss="modal">
                    <span class="ui-button-text">
                        <i class="icon-remove bigger-110"></i>
                        取 消
                    </span>
                </button>
            </div>
        </div>
    </div>
</div>